import {NgModule} from '@angular/core';
import {ExtraOptions, RouterModule, Routes} from '@angular/router';
import {LoginComponent} from './pages/basic/login/login.component';
import {Authentication} from './pages/basic/auth/authentication';

const routes: Routes = [
    {path: '', redirectTo: 'login', pathMatch: 'full'},
    {path: 'login', component: LoginComponent},
    {path: 'workbench', loadChildren: './pages/workbench/workbench.module#WorkbenchModule', canLoad: [Authentication]},
    {path: '**', component: LoginComponent}
];

const config: ExtraOptions = {
    useHash: true
};

@NgModule({
    imports: [RouterModule.forRoot(routes, config)],
    exports: [RouterModule]
})
export class AppRoutingModule {
}
